package com.kashi.controller;

import com.kashi.pojo.Result;
import com.kashi.service.ImageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/api")
public class ImageController {
    @Autowired
    private ImageService imageService;

    @GetMapping("/image/:{id}")
    public Result get(@RequestParam Integer id){
        log.info("根据id查询图片的URL地址：{}",id);
        //调用service查询
        String url = imageService.get(id);
        return Result.success(url);
    }

}
